<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue2.2.js"></script>
    <link rel="stylesheet" href="animate.css">
    <style>
        .v-enter, .v-leave-to {
            opacity: 0;
        }

        .v-enter-active, .v-leave-action {
            transition: opacity 1s;
        }
    </style>
</head>
<body>
<div id="app">
    <transition mode="in-out">
        <div v-if="show" key="hello">xiaxiang</div>
        <div v-else key="bye">Bye World</div>
    </transition>
    <button @click="handleClick">显示/隐藏</button>
</div>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            show: true
        },
        methods: {
            handleClick: function () {
                this.show = !this.show;
            }
        }
    })
</script>
</body>
</html>